<table id="datagrid_${action_id}" ></table>
<div id="datagrid_tb_${action_id}" style="padding:5px;height:auto">
	${action.getDatagridTitle('gmtCreate')}: <input class="easyui-datebox" data-options="editable:false" name="_searcher_ge_gmtCreate?date">
		TO: <input class="easyui-datebox" data-options="editable:false" name="_searcher_le_gmtCreate?date" >
		&nbsp;&nbsp;&nbsp;&nbsp;
	${action.getDatagridTitle('state')}:
	<select class="easyui-combobox" name="_searcher_eq_state?int" style="width: 120px;">
		<option value="" >---</option>
		<#list states as st>
			<#if st.state!=-1>
				<option value="${st.state}" >${action.getDatagridTitle('state.'+st.name())}</option>
			</#if>
		</#list>
	</select>
	&nbsp;&nbsp;&nbsp;&nbsp;
	${action.getDatagridTitle('id')}:
	<input class="easyui-validatebox" style="width: 200px;" name="_searcher_lky_id" >
	&nbsp;&nbsp;&nbsp;&nbsp;
	<a href="javascript:;;" onclick="javascript:$('#datagrid_tb_${action_id}').searcher('doSearch')" class="easyui-linkbutton" iconCls="icon-search">查询</a>
</div>
<script type="text/javascript">

$(function(){
	
	$('#datagrid_tb_${action_id}').searcher({
		doSearch:function(qp){
			$('#datagrid_${action_id}').datagrid('options').queryParams = qp;
			$('#datagrid_${action_id}').datagrid('reload');
		}
	});
	
	$('#datagrid_${action_id}').datagrid({
		iconCls:'icon-save',
		width:'auto',
		height:'auto',
		nowrap: false,
		fit:true,
		fitColumns:true,
		striped: true,
		url:'${request.contextPath}${namespace?default('')}/mp/eb/order-datagrid.json',
		sortName: 'gmtCreate',
		sortOrder: 'desc',
		remoteSort: true,
		singleSelect : true,
		idField:'id',
		singleSelect : ${cb?string('false','true')},
		onBeforeLoad:function(){$('#datagrid_${action_id}').datagrid('unselectAll');},
		columns:[[
					{field:'id',title:'${action.getDatagridTitle('id')}',width:80,align:'center',sortable:false},
					{field:'product',title:'${action.getDatagridTitle('product')}',width:80,align:'center',sortable:false,formatter:function(val,rec){
						return rec.product.classify.name + "  " + val.name;
					}},
					{field:'member',title:'${action.getDatagridTitle('member')}',width:80,align:'center',sortable:false,formatter:function(val,rec){
						if(val){
							return val.mobile;
						}
						
					}},
					{field:'colour',title:'${action.getDatagridTitle('colour')}',width:80,align:'center',sortable:true},
					{field:'gmtCreate',title:'${action.getDatagridTitle('gmtCreate')}',width:80,align:'center',sortable:true},
					{field:'payTime',title:'${action.getDatagridTitle('payTime')}',width:80,align:'center',sortable:true},
					{field:'putTime',title:'${action.getDatagridTitle('putTime')}',width:80,align:'center',sortable:true},
					{field:'state',title:'${action.getDatagridTitle('state')}',width:80,align:'center',sortable:false,formatter:function(val,rec){
						<#list states as st>
							if(${st.state}==val){
								if(${st.state}==1){
									return '<span style="color:red">${action.getDatagridTitle('state.'+st.name())}</span>';
								}else if(${st.state}==2){
									return '<span style="color:BLUE">${action.getDatagridTitle('state.'+st.name())}</span>';
								}else{
									return '${action.getDatagridTitle('state.'+st.name())}';
								}
							}
						</#list>
					}},
					{field:'remarks',title:'${action.getDatagridTitle('remarks')}',width:80,align:'center',sortable:true}
				]],
		pagination:true,
		rownumbers:true,
		toolbar:'#datagrid_tb_${action_id}',
		onDblClickRow:function(idx,data){if(typeof onDblClickRow_${action_id} != 'undefined'){onDblClickRow_${action_id}(idx,data)}},
		onClickRow:function(idx,data){if(typeof onClickRow_${action_id} != 'undefined'){onClickRow_${action_id}(idx,data)}},
		onRowContextMenu:function(e,idx,data){if(typeof onRowContextMenu_${action_id} != 'undefined'){$(this).datagrid('selectRow', idx);onRowContextMenu_${action_id}(e,idx,data)}}
	});

});


</script>	
